'use strict';
const db = uniCloud.database()
exports.main = async (event, context) => {

	const userInfo = await db.collection('uni-id-users').where({
		username: event.username
	})
	const res = await userInfo.get(event)
	//返回数据给客户端
	const cartNum = res.data[0].cart.length
	return cartNum
};
